package com.lagou.task10;

public class People {

    private String name;
    private int id;
    private int salary;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        if (id > 0) {
            this.id = id;
        } else {
            System.out.println("id不合理哦！");
        }
    }

    public int getSalary() {
        return salary;
    }

    public void setSalary(int salary) {
        if (salary > 0) {
            this.salary = salary;
        } else {
            System.out.println("工资不合理哦！");
        }
    }

    public People() {
    }

    public People(String name, int id, int salary) {
        setId(id);
        setSalary(salary);
        setName(name);
    }
    public void show() {
        System.out.println("工资：" + getSalary() + "，工号：" + getId() + ",姓名：" + getName());
    }
    public void work() {
        System.out.println();
    }
}
